package com.example.yuejian.Model;

import com.example.yuejian.Bean.RegBean;
import com.example.yuejian.RetrofitListener;
import com.example.yuejian.Service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by 释怀 on 2018/9/27.
 */

public class RegModel extends RetrofitBaseModel {

    public Retrofit retiofit;
    private String BASEURL="yuejian/public/index.php/api/user/";
    private String IP="http://172.19.163.68/";

    public RegModel(){
        retiofit=new Retrofit.Builder()
                .baseUrl(IP+BASEURL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();

    }
    public void userReg(String username,String password,String userphone,final RetrofitListener listener) {
        UserService Service=retiofit.create(UserService.class);
        Call<RegBean> call= Service.Reg(username,password,userphone);
        bindCallback(call,listener,2);

    }



}
